EXISTS
FILE SUB>
fSave (
OPTIONAL
sRoot AS
String )
target AS
String
a AS
Integer sLine AS String
EndOfLine AS String: 'tag used if not willing overwrite the file, return to program at beginning of Dialog.SaveFile() sRoot =
""
THEN Dialog. Title
=
"Enter
a filename to save the
data" Dialog. Path
=
"" Dialog. Filter
=
[ "*.
lis"
, "Listin
Data"
] a =
Dialog.
SaveFile ()
a =
- 1
THEN GOTO ends Right $
( Dialog.
Path
, Len
( .
"lis"
)) <> ". lis"
THEN target =
Dialog. Path
&
. "lis" target =
Dialog. Pathtarget = sRootENDIF CheckExist(target,
"Phone"
) =
2
THEN GOTO initEndOfLine =
"|" =
"v0.0.1"
&
codigofinline 'reported
versionsLine &
=
"listin.20100718"
&
codigofinline 'program
that echo the filesLine &
=
var. id
. COUNT
&
codigofinline 'number
of existing
records FOR
a =
0 TO
var. id
. COUNT
-
1 sLine &
=
var. id
[a] & EndOfLine sLine &
=
var. dni
[a] & EndOfLine sLine &
=
var. name
[a] & EndOfLine sLine &
=
var. surname
[a] & EndOfLine sLine &
=
var. company[a] & EndOfLine sLine &
=
var. position
[a] & EndOfLine sLine &
=
var. tel_company
[a] & EndOfLine sLine &
=
var. tel_private
[a] & EndOfLine sLine &
=
var. fax
[a] & EndOfLine sLine &
=
var. mobile_company[a] & EndOfLine sLine &
=
var. mobile_private
[a] & EndOfLine sLine &
=
var. page
[a] & EndOfLine sLine &
=
var. photo
[a] & EndOfLine sLine &
=
var. address
[a] & EndOfLine sLine &
=
var. comments
[a] & EndOfLine sLine &
=
var. data_date
[a] & EndOfLine sLine &
=
var. mail
[a] & EndOfLine NEXT . Save (
target, sLine )ends: 'we hit
the cancel button in
the dialog box Dialog.SaveFile
()And
from the form FMAIN in File / Save, we execute the code: SUB
Save_Click () file. save
()
END Important
Note: As you will realize, the picture files are not stored, only are the pathes where they are located. When we move the data from one computer to another, these pictures will not appear. See Appendix 4: packing / unpacking of data, where explains a suitable solution |